Spread for ASP.NET 9.0 Product Documentation
Group(SortInfo[],IComparer) Method
Example 


Sort information
Comparer
Groups the rows with the specified sort information and specified comparer.
Syntax
'Declaration
 
Public Overloads Sub Group( _
   ByVal sortInfo() As SortInfo, _
   ByVal groupComparer As IComparer _
) 
'Usage
 
Dim instance As GroupDataModel
Dim sortInfo() As SortInfo
Dim groupComparer As IComparer
 
instance.Group(sortInfo, groupComparer)
public void Group( 
   SortInfo[] sortInfo,
   IComparer groupComparer
)

Parameters

sortInfo
Sort information
groupComparer
Comparer
Example
This example groups the data model.
private void button1_Click(object sender, EventArgs e)
{
FarPoint.Web.Spread.Model.GroupDataModel gm = new FarPoint.Web.Spread.Model.GroupDataModel(FpSpread1.ActiveSheetView.DataModel);
FarPoint.Web.Spread.SortInfo[] sort = new FarPoint.Web.Spread.SortInfo[1];
sort[0] = new FarPoint.Web.Spread.SortInfo(0, true);
gm.Group(sort, System.Collections.Comparer.Default);
FpSpread1.ActiveSheetView.DataModel = gm;

String msg = gm.Groups.Count.ToString();
Response.Write("alert('" + msg + "')");
}
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim gm As New FarPoint.Web.Spread.Model.GroupDataModel(FpSpread1.ActiveSheetView.DataModel)
Dim sort(0) As FarPoint.Web.Spread.SortInfo
sort(0) = New FarPoint.Web.Spread.SortInfo(0, True)
gm.Group(sort, System.Collections.Comparer.Default)
FpSpread1.ActiveSheetView.DataModel = gm
String msg = gm.Groups.Count.ToString();
Response.Write("alert('" & msg & "')");
End Sub
Requirements

Target Platforms: Windows 7, Windows 8, Windows 10, Windows Vista, Windows Server 2003, Windows Server 2008, Windows Server 2012, Windows XP Professional

See Also

Reference

GroupDataModel Class
GroupDataModel Members
Overload List

 

 


Copyright © GrapeCity, inc. All rights reserved.